package com.fita.admin.service.authority;

import com.demo2do.core.entity.page.Page;
import com.demo2do.core.persistence.support.QueryFilter;
import com.fita.admin.entity.security.Login;
import com.fita.admin.service.DataService;
import com.fita.entity.principal.District;
import com.fita.entity.principal.Principal;

import java.util.List;

/**
 * 
 * @author dan
 *
 */
public interface PrincipalService extends DataService<Principal> {
    
    /**
     * 
     * @param login
     * @return
     */
    public int count(Login login);
    
    /**
     * 
     * @param login
     * @param page
     * @return
     */
    public List<Principal> list(Login login, Page page);
    
    /**
     * 
     * @param name
     * @return
     */
    public Principal loadByName(String name);

    
    /**
     * @param principal
     * @param district
     */
    public void createPrincipal(Principal principal,District district);

    /**
     * @param principal
     * @param districtId
     */
    public void updatePrincipal(Principal principal, District district);

    /**
     * @param principal
     */
    public void resetPassword(Principal principal);

    /**
     * @param principal
     */
    public void activate(Principal principal);

    /**
     * @param principal
     */
    public void freeze(Principal principal);

    /**
     * @param class1
     * @param preparedFilter
     * @return
     */
    public int countSearch(Class<Principal> class1, QueryFilter preparedFilter);

    public List<Principal> listSaleUser();

    /**
     * @param principal
     * @param password
     */
    public void changePassword(Principal principal, String password);
    
    /**
     * 
     * @param authorities
     * @param district
     * @return
     */
    public List<Principal> list(List<String> authorities, District district);

}
